<layout name='Layout/layout_popup' />
<script src="__PUBLIC__/js/swfobject/swfobject.js"></script>
<input type="hidden" id="vod_url" value="" />
<div class="text-center" >
	<span class="left"><h4>视频播放</h4></span>
	<a class="right" onclick="myclose();"><h4><i class="icon-remove"></i></h4></a>
	<div id="flashContent" >
		<p><a href="http://www.adobe.com/go/getflashplayer">
		<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="请下载安装 Adobe Flash player" /></a></p>
	</div>
</div>
<!--<input type="button" id="hhh" value="save" onclick="studayHIs();" />-->
<script>
var video_file="/{$video_file}?"+Date.parse(new Date());
var file_ext="{$video_ext}";
var f2="{$file2|default=$uri}";
var user_id="{$user_id}";
var _sec=0;
var _type="{$_GET.type}";
var _video_id="{$_GET.id}";
var _course_id="{$_GET.course}";
var _start_time="{:date('Y-m-d H:i:s')}";
var _play="{$play}";


function initData(){
	var type="{$_GET.type}";
	//alert("{$cknum|default=C2('PX_CK')}");
	//alert(t+' : '+_notStuday);
	if(type=="learn" && _play=="1"){		
		document.getElementById("player").initData($("#vod_url").val(),user_id,'',3,.80);
	}else{		
		document.getElementById("player").initData($("#vod_url").val(),user_id,'',5,.8,10,0,0,false);
	}
}

function courseResult(result) {
    if ((result[0] == '1' || parseInt(result[0]) > 0) && _type=='learn'){
		learn_his();
    }
}

function learn_his(){
	$.post('{:U("course/save_his")}',{
		course_id:_course_id,
		user_id:user_id,
		type:_type,
		video_id:_video_id,
		file:video_file,
		start_time:_start_time,
		sec:_sec
	});
}

function _courseResult(result) {
    alert("_"+result[0]);
}

function online(sec) {
    _sec=sec;
}

$(document).ready(function(e){
	if(user_id!=""){
		if(file_ext=="mp4"){
			$("#vod_url").val(video_file);
			var flashvars = {};
			var params = {
			  menu: "false",
			  allowfullscreen:"true",
			  allowscriptaccess:"true"
			};
			var attributes = {
			  id: "player",
			  name: "player"
			};
			swfobject.embedSWF("__PUBLIC__/js/player/player.swf", "flashContent", "550", "400", "9.0.0", "expressInstall.swf",flashvars, params, attributes);
		}else{
			alert("格式不正确");
			setTimeout(function(){
				myclose();
			},0)			
		}
	}else{
		alert("请重新登陆！");
	}
});
</script>